home *** CD-ROM | disk | FTP | other *** search
- Path: aadt.sdt.com!usenet
- From: Larry Baker <leb@sdt.com>
- Newsgroups: comp.lang.c++,comp.os.ms-windows.programmer.win32
- Subject: Re: VC++ 4.0 memory allocation slower than in 2.x!!!
- Date: Fri, 29 Mar 1996 16:56:35 -0800
- Organization: SABRE Decision Technologies
- Message-ID: <315C86C3.57BE@sdt.com>
- References: <alanDozpsy.Kn6@netcom.com> <4jgde4$kgo_001@chem.uva.nl>
- NNTP-Posting-Host: parmail.sdt.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win16; I)
-
- Danny Brands wrote:
- > Check the the latest issues of Byte. I think, in the march issue
- > they have an article on this. They were running preformance analysis
- > programs which did a lot of malloc stuff with unreproducable
- > results. I appeared that it had to do with the allignment
- > of the allocated block in memory if I understood it well.
-
- What was happening was that malloc was returning
- byte-aligned allocations. This is a problem for things like
- floats, doubles, ints and longs, as they have a significant
- hardware-level performance penalty (on the Pentium, among others)
- if they aren't aligned on a 32-bit word boundary.
-
- After they used their own (modified) allocation routines (which
- really just encapsulated calls to malloc/free, but gauranteed
- word-aligned allocations) everything went back to normal.
- I believe they posted their allocation routines to BIX or
- elsewhere.
-
- Note that this has nothing to do with the actual performance of
- malloc and free themselves; this has to do with the performance of
- the routines that use the memory allocated *by* malloc.
-
- Cheers,
-
- Larry Baker
- leb@sdt.com
-